//
// Created by Biter on 2019/10/15.
//
#include <iostream>
#include "includes/Person.h"

int main() {
    Person person0;
    //第一种创建对象的方式
    Person person1 = Person("binny1,显示调用构造函数", 26);
//    //第二种创建对象的方式
    Person person2("binny2，隐式调用构造函数", 27);
//    //第三种创建对象的方式
    Person *pPerson3 = new Person("binny3，动态创建对象", 8);

    //c++11 列表初始化
    Person person4 = {"binny4，显示列表初始化", 26};
    Person person5{"binny5，隐式列表初始化", 26};
    Person *pPerson6 = new Person{"binny6，动态列表初始化", 26};

    std::cout << "person1 name = " << person1.getName() << std::endl;
    std::cout << "person2 name = " << person2.getName() << std::endl;
    std::cout << "person3 name = " << pPerson3->getName() << std::endl;
    std::cout << "person4 name = " << person4.getName() << std::endl;
    std::cout << "person5 name = " << person5.getName() << std::endl;
    std::cout << "person6 name = " << pPerson6->getName() << std::endl;

    Person person7 = 26;
    person7.setName("p9");
    std::cout << "p9.getAge() = " << person7.getAge() << std::endl;
    return 0;
}